import Vue from 'vue'
import VueRouter from 'vue-router'

// #####
import Login from '../views/users/Login.vue'
import Register from '../views/users/Register.vue'
import Container from '../views/containers/Container.vue'
//
import Home from '../views/Home/Home.vue'
import GanJi from '../views/ganji/ganji.vue'
import chart1 from '../views/charts/chart1.vue'
import chart2 from '../views/charts/chart2.vue'
//
import tables from '../views/tables/tables.vue'


import Setting from '../views/users/Setting.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    
    component: Login,
    meta: {
      title: '登录'
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
    meta: {
      title: '注册'
    }
  },
  {
    path: '/',
    redirect: '/Home',
    name: '首页',
    component: Container,
    meta: {
      breadcrumb: '首页',
    },
    children: [
      {
        path: '/Home',
        name: 'Home',
        component: Home,
        meta: {
          breadcrumb: 'Home',
          title: 'Home',
        }
      },
      {
        path: '/GanJi',
        name: 'GanJi',
        component: GanJi,
        meta: {
          breadcrumb: 'GanJi',
          title: 'GanJi',
        }
      },
      {
        path: '/chart1',
        name: 'chart1',
        component: chart1,
        meta: {
          breadcrumb: 'chart1',
          title: 'chart1',
        }
      },
      {
        path: '/chart2',
        name: 'chart2',
        component: chart2,
        meta: {
          breadcrumb: 'chart2',
          title: 'chart2',
        }
      },
      {
        path: '/tables',
        name: 'tables',
        component: tables,
        meta: {
          breadcrumb: 'tables',
          title: 'tables',
        }
      },
      {
        path: '/Setting',
        name: 'Setting',
        component: Setting,
        meta: {
          breadcrumb: 'Setting',
          title: 'Setting',
          // requireLogin: true
        }
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
